package com.greate.community.entity;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.util.Date;

/**
 * 帖子实体类
 * 用于存储论坛中的帖子信息
 * @author 海航源
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Post {
    /**
     * 帖子ID
     */
    private int id;
    
    /**
     * 发布帖子的用户ID
     */
    private int userId;
    
    /**
     * 帖子标题
     */
    private String title;
    
    /**
     * 帖子内容
     */
    private String content;
    
    /**
     * 帖子类型
     * 0-普通; 1-置顶
     */
    private int type;
    
    /**
     * 帖子状态
     * 0-正常; 1-精华; 2-拉黑
     */
    private int status;
    
    /**
     * 帖子创建时间
     */
    private Date createTime;
    
    /**
     * 评论数量
     */
    private int commentCount;
    
    /**
     * 帖子分数（用于排序）
     */
    private double score;

    @Override
    public String toString() {
        return "Post{" +
                "id=" + id +
                ", userId=" + userId +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", type=" + type +
                ", status=" + status +
                ", createTime=" + createTime +
                ", commentCount=" + commentCount +
                ", score=" + score +
                '}';
    }
}